/**
 * 项目用物料表 api 封装
 *
 * @Author:    yurui
 * @Date:      2024-07-20 15:28:16
 * @Copyright  jz
 */
import { postRequest, getRequest } from '/@/lib/axios';

export const projectMaterialApi = {
  /**
   * 分页查询  @author  yurui
  */
  queryPage: (param) => {
    return postRequest('/projectMaterial/queryPage', param);
  },
  queryProjectId: (projectId) => {
    return getRequest(`/usageOutbound/queryBy/${projectId}`);
  },
  //@GetMapping("/usageOutbound/queryBy/{projectId}")

  /**
   * 增加  @author  yurui
   */
  add: (param) => {
    return postRequest('/projectMaterial/add', param);
  },

  /**
   * 修改  @author  yurui
   */
  update: (param) => {
    return postRequest('/projectMaterial/update', param);
  },

  /**
   * 删除  @author  yurui
   */
  delete: (id) => {
    return getRequest(`/projectMaterial/delete/${id}`);
  },

  /**
   * 批量删除  @author  yurui
   */
  batchDelete: (idList) => {
    return postRequest('/projectMaterial/batchDelete', idList);
  },
  //弹框分类
  ClassificationData: (param) => {
    return postRequest('/category/tree', param);
  },
  //   分类传参
  ClassificationReference: (obj) => {
    return getRequest('/materialBase/queryAll/' + obj.categoryId);
  },
};
